Numeric
๐ Numeric Extensionsโ
Factorial
int result = 5.Factorial(); // 120
Root Finding (NewtonโRaphson) โ
Func<double, double> func = x => Math.Pow(x, 2) - 4;
double root = func.NewtonRaphson(); // 2
๐ข Number Theoryโ
bool prime = 79.IsPrime(); // true
int[] factors = 78.GetPrimeFactors(); // [2, 3, 13]
bool happy = 19.IsHappy(); // true
bool perfect = 6.IsPerfectNumber(); // true
int decimals = 0.01.GetDecimalPlaces(); // 2
๐ Trigonometryโ
double rad = 180.0.DegreeToRadians(); // ฯ